<!-- 入驻列表 -->
<style>
	th {
		text-align: center;
	}
	
	.table>tbody>tr>td {
		line-height: 60px;
		text-align: center;
		height: 50px;
		margin: 0px;
	}
</style>
<!-- 省市三级连动 -->
<script src="__PUBLIC__/ganged/Js/jquery.js"></script>
<script src="__PUBLIC__/ganged/Js/city-picker.data.js"></script>
<script src="__PUBLIC__/ganged/Js/city-picker.js"></script>
<script src="__PUBLIC__/ganged/Js/main.js"></script>
<!-- css -->
<link href="__PUBLIC__/ganged/Css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/ganged/Css/city-picker.css" rel="stylesheet" type="text/css" />

<div id="data_page" class="in_page">

		
	<table class="table table-striped table-bordered table-condensed ">
		<thead>
			<tr>

				<th>店主</th>
				<th>店铺名</th>

				<th>详细地址</th>
				<th>电话</th>

				<th>人气</th>
	
				<th>状态</th>
				<th>评论星数</th>

			</tr>
		</thead>
		<tbody>
			<volist name="list" id="li">
				<tr>

					<td >{$li.name}</td>
					<td>{$li.shopname}</td>

					<td>{$li.addr}</td>
					<td>{$li.phone}</td>

					<td>{$li.renqi}</td>
				
					<td>
						<if condition="$li.status eq '3'"><font color="red">休业中</font></if>
						<if condition="$li.status eq '1'"><font color="green">营业中</font></if>
					</td>
					<td>{$li.pinglun}</td>

				</tr>
			</volist>
		</tbody>
	</table>
</div>
<div>{$page}</div>

<style>
	#img{
	  width:700px;
	  height:550px;
	  position: absolute;
	  top:5%;
	  left:20%;
	  background-color: #FFFFFF;
	  border-radius: 10px;
	  box-shadow:10px 10px 10px 5px #888888;
	}
	
	#order{
		width:100px;
		height:20px;
		display: block;
	}
	
	#Stick{
	  width:500px;
	  height:300px;
	  position: absolute;
	  top:5%;
	  left:20%;
	  background-color: #FFFFFF;
	  border-radius: 10px;
	  box-shadow:10px 10px 10px 5px #888888;	
	}
	
	#tuichu{
		position: absolute;
		right:0px;
		bottom:0px;
	}
</style>
<script>
	$(function(){
		//置顶显示
		$(".top").click(function(){
			var id = $(this).attr("d_id");
			var area = $(this).attr("d_a");
			var left= ($(window).width()-$("#Stick").width)/2
			var top  = ($(window).height()-$("#Stick").height)/2
			var scrollTop = window.scrollLeft;
			var scrollLeft = window.scrollHeight; 
			$("#Stick").css({position:"absolute",'top':top+scrollTop,left:left + scrollLeft}).slideDown();
			//置顶功能
			$("#check").click(function(){
				var url = "{:U('Store/topInfo')}";
				var sort = $("#order").val();
				var data = {
					id:id,
					sort:sort,
					area:area,
				}
				$.post(url,data,function(obj){
					if(obj.s == true){
						alert(obj.m);
						$("#Stick").slideUp();
						location.reload();
					}else{
						alert(obj.m);
						$("#Stick").slideUp();
						location.reload();
					}
				})
			})

		})
		//取消置顶
		$(".delTop").click(function(){
			var id = $(this).attr("d_id");
			var url = "{:U('Store/delTopInfp')}?id="+id;
			$.get(url,function(obj){
				if(obj.s){
					alert(obj.m);
					location.reload();
				}
			})

		})

		//图片显示
		$(".lun").click(function(){
			var id = $(this).attr("d_id");

			var left= ($(window).width()-$("#img").width)/2
			var top  = ($(window).height()-$("#img").height)/2
			var scrollTop = window.scrollLeft;
			var scrollLeft = window.scroHeight; 
			$("#img").css({position:"absolute",'top':top+scrollTop,left:left + scrollLeft}).slideDown();
			
			show(id);
		})

		$("#tuichu").click(function(){
			$("#img").slideUp();
			location.reload();
		});
		//置顶退出
		$(".out").click(function(){
			$("#Stick").slideUp();
			location.reload();
		})

		function show(id){
			var url ="{:U('Store/show')}?id="+id;
			$.get(url,function(obj){
				if(obj.s){

					$.each(obj.d,function(i,a){
						
						var showhtml = "";
						$.each(a['showimg'],function(j,q){
							 showhtml += "<img src='"+q+"' width=150px height=150px>";
						})
						$("#Shuffling").html(showhtml);
						

						var listhtml = "<img src='"+a['listimg']+"' width=150px height=150px>";
						$("#list").html(listhtml);
						
						var yyzzhtml = "<img src='"+a['yyzzimg']+"' width=150px height=150px>";
						$("#yyzz").html(yyzzhtml);
					})
				}
			});
		} 
		//关闭店铺
		$(".cl").click(function(){
			var id=$(this).attr("d_id");
			var url = "{:U('Store/close')}?id="+id;
			if(confirm("确认关闭店铺吗?")){
				$.get(url,function(obj){
					if(obj.s){
						alert(obj.m);
						location.reload();
					}
				})
			}
			return false;
		})
		
		//开启店铺
		$(".open").click(function(){
			var id=$(this).attr("d_id");
			var url = "{:U('Store/open')}?id="+id;
				$.get(url,function(obj){
					if(obj.s){
						alert(obj.m);
						location.reload();
					}
				})
		})

		//删除店铺
		$(".del").click(function(obj){
			$_this = $(this);
			var id = $(this).attr("d_id");
			var url = "{:U('Store/del')}?id="+id;
			if(confirm("相应的用户信息和地址也会删除,您确认删除吗?")){
				$.get(url,function(obj){
					if(obj.s){
						alert(obj.m);
						$_this.parent().parent().remove();
					}
				})
			}
			return false;
		})
                                               
	})

</script>
